﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace comdiinfo
{
    public class G64NumberOfTracks : G64Element<byte>
    {
        public G64NumberOfTracks(int trackNo)
            : base(trackNo)
        {
            elementName = "Number of Tracks";
        }
        public override void LoadData(ref G64ImageData imgData, int srcOffset, int count)
        {
            ElementValue = imgData.readBytes(9, 1, elementName)[0];
        }
        public override void CheckValue()
        {
            if (ElementValue == 84)
            {
                elementStatus = G64ElementStatus.Ok;
            }
            else
            {
                if ((ElementValue >= 70) && (ElementValue < 84))
                {
                    elementStatus = G64ElementStatus.Warning;
                    elementStatusText.AppendFormat("{0} {1} ({2})", elementName, "ist kleiner als 84", ElementValue.ToString());
                    elementStatusText.AppendLine();
                }
                else
                {
                    elementStatus = G64ElementStatus.Warning;
                    elementStatusText.AppendFormat("{0} {1} ({2})", elementName, "musss mind. 70 und höchstens 84 sein", ElementValue.ToString());
                    elementStatusText.AppendLine();
                }
            }
        }
    }
}
